let pi=new Vue({
    el:'#main',
    data:{
        oneFilm:{},
        oneFilmCount:'',
        twoFilm:{},
        twoFilmCount:'',
        threeFilm:{},
        threeFilmCount:'',
        fourFilm:{},
        fourFilmCount:'',
        fiveFilm:{},
        fiveFilmCount:'',

        sixFilm:{},
        sixFilmCount:'',
        sevenFilm:{},
        sevenFilmCount:'',
        eightFilm:{},
        eightFilmCount:'',
        nineFilm:{},
        nineFilmCount:'',
        tenFilm:{},
        tenFilmCount:''
    },
    created(){
        $.get('http://localhost:8080/cinema/api/FilmPaiMingServlet.do', function (dto) {
            let formData1 = {
                filmId: dto.value[0].filmId
            }
            $.get('http://localhost:8080/cinema/api/SelectFilmByIdServlet.do', formData1, function (dto1) {
                pi.oneFilm = dto1.value;
            });
            $.get('http://localhost:8080/cinema/api/SelectCountByFilmIdServlet.do', formData1, function (dto11) {
                pi.oneFilmCount = dto11.value;
            });


            let formData2 = {
                filmId: dto.value[1].filmId
            }
            $.get('http://localhost:8080/cinema/api/SelectFilmByIdServlet.do', formData2, function (dto2) {
                pi.twoFilm = dto2.value;
            });
            $.get('http://localhost:8080/cinema/api/SelectCountByFilmIdServlet.do', formData2, function (dto22) {
                pi.twoFilmCount = dto22.value;
            });


            let formData3 = {
                filmId: dto.value[2].filmId
            }
            $.get('http://localhost:8080/cinema/api/SelectFilmByIdServlet.do', formData3, function (dto3) {
                pi.threeFilm = dto3.value;
            });
            $.get('http://localhost:8080/cinema/api/SelectCountByFilmIdServlet.do', formData3, function (dto33) {
                pi.threeFilmCount = dto33.value;
            });


            let formData4 = {
                filmId: dto.value[3].filmId
            }
            $.get('http://localhost:8080/cinema/api/SelectFilmByIdServlet.do', formData4, function (dto4) {
                pi.fourFilm = dto4.value;
            });
            $.get('http://localhost:8080/cinema/api/SelectCountByFilmIdServlet.do', formData4, function (dto44) {
                pi.fourFilmCount = dto44.value;
            });


            let formData5 = {
                filmId: dto.value[4].filmId
            }
            $.get('http://localhost:8080/cinema/api/SelectFilmByIdServlet.do', formData5, function (dto5) {
                pi.fiveFilm = dto5.value;
            });
            $.get('http://localhost:8080/cinema/api/SelectCountByFilmIdServlet.do', formData5, function (dto55) {
                pi.fiveFilmCount = dto55.value;
            });



            let formData6 = {
                filmId: dto.value[5].filmId
            }
            $.get('http://localhost:8080/cinema/api/SelectFilmByIdServlet.do', formData6, function (dto6) {
                pi.sixFilm = dto6.value;
            });
            $.get('http://localhost:8080/cinema/api/SelectCountByFilmIdServlet.do', formData6, function (dto66) {
                pi.sixFilmCount = dto66.value;
            });


            let formData7 = {
                filmId: dto.value[6].filmId
            }
            $.get('http://localhost:8080/cinema/api/SelectFilmByIdServlet.do', formData7, function (dto7) {
                pi.sevenFilm = dto7.value;
            });
            $.get('http://localhost:8080/cinema/api/SelectCountByFilmIdServlet.do', formData7, function (dto77) {
                pi.sevenFilmCount = dto77.value;
            });


            let formData8 = {
                filmId: dto.value[7].filmId
            }
            $.get('http://localhost:8080/cinema/api/SelectFilmByIdServlet.do', formData8, function (dto8) {
                pi.eightFilm = dto8.value;
            });
            $.get('http://localhost:8080/cinema/api/SelectCountByFilmIdServlet.do', formData8, function (dto88) {
                pi.eightFilmCount = dto88.value;
            });


            let formData9 = {
                filmId: dto.value[8].filmId
            }
            $.get('http://localhost:8080/cinema/api/SelectFilmByIdServlet.do', formData9, function (dto9) {
                pi.nineFilm = dto9.value;
            });
            $.get('http://localhost:8080/cinema/api/SelectCountByFilmIdServlet.do', formData9, function (dto99) {
                pi.nineFilmCount = dto99.value;
            });


            let formData10 = {
                filmId: dto.value[9].filmId
            }
            $.get('http://localhost:8080/cinema/api/SelectFilmByIdServlet.do', formData10, function (dto10) {
                pi.tenFilm = dto10.value;
            });
            $.get('http://localhost:8080/cinema/api/SelectCountByFilmIdServlet.do', formData10, function (dto100) {
                pi.tenFilmCount = dto100.value;
            });


        });
    }
});